import request from '@/utils/request'
import {
  queryChannelList,
  exportChannelOrder,
  queryChannelAuditRecordList,
  getChannelDetail,
  optChannelOrderAudit,
  optCancelOrder
} from '../apis'

/**
 * 渠道选货列表
 */
export function getChannelList(query) {
  return request({
    url: queryChannelList,
    method: 'get',
    params: query
  })
}

/**
 * 订单审核
 * @param data
 */
export function audit(data) {
  return request({
    url: optChannelOrderAudit,
    method: 'post',
    data
  })
}

/**
 * 作废订单
 * @param data
 */
export function cancelOrder(data) {
  return request({
    url: optCancelOrder,
    method: 'post',
    data
  })
}

/**
 * 审核记录
 * @param data
 */
export function queryAuditRecord(data) {
  return request({
    url: queryChannelAuditRecordList,
    method: 'get',
    params: data
  })
}

/**
 * 订单导出
 * @param data
 */
export function exportOrders(data) {
  return request({
    url: exportChannelOrder,
    method: 'get',
    params: data
  })
}

/**
 * 渠道订单详情
 * @param data
 */
export function channelDetail(data) {
  return request({
    url: getChannelDetail,
    method: 'get',
    params: data
  })
}
